''' 定义 learing_logs 的urls '''

from django.conf.urls import url
from . import views

#注意 这里是一个list对象不是dict
urlpatterns = [
    url(r'^$',views.index,name='index'),
    url(r'^topics/$',views.topics,name='topics'),
    url(r'^topic/(?P<topic_id>\d+)/$',views.topic,name='topic'), # ?P<topic_id> 把捕获到数字储存在 topic_id 变量中
    url(r'^new_topic/$',views.new_topic,name='new_topic'),
    url(r'^new_entry/(?P<topic_id>\d+)/$',views.new_entry,name='new_entry'),
    url(r'^edit_entry/(?P<entry_id>\d+)/$',views.edit_entry,name='edit_entry'),
    url(r'^blogs/(?P<user_id>\d+)/$',views.blogs,name='blogs'),
    url(r'^blog/(?P<blog_id>\d+)/$',views.blog,name='blog'),
    url(r'^new_blog/$',views.new_blog,name='new_blog'),
    url(r'^del_blog/(?P<blog_id>\d+)/$',views.del_blog,name='del_blog'),
    url(r'^edit_blog/(?P<blog_id>\d+)/$',views.edit_blog,name='edit_blog'),
]


